package com.jams.goodox.net.services;

import com.jams.goodox.constant.UrlConstants;
import com.jams.goodox.entity.BusInfoBySubIdPart;
import com.jams.goodox.entity.CheckGoodsResult;
import com.jams.goodox.entity.OnlineShopInfoResp;
import com.jams.goodox.entity.ProductDetailBean;
import com.jams.goodox.entity.RedRed;
import com.jams.goodox.entity.ServicePauseTime;
import com.jams.goodox.entity.ServicePeriod;
import com.jams.goodox.entity.UpLoadPicBean;
import com.jams.goodox.entity.resp.AddOrderResp;
import com.jams.goodox.entity.resp.AliInfoResp;
import com.jams.goodox.entity.resp.CanUseRedPacketResp;
import com.jams.goodox.entity.resp.LifeIndexListResp;
import com.jams.goodox.entity.resp.OnLineProductListResp;
import com.jams.goodox.entity.resp.PersonalRentingResp;
import com.jams.goodox.entity.resp.RentingHouseResp;
import com.jams.goodox.entity.resp.ShopCategoryResp;
import com.jams.goodox.entity.resp.ShopCommentListResp;
import com.jams.goodox.entity.resp.SurroundingListResp;
import com.jams.goodox.net.BaseEntity;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * Description 生活服务
 */
public interface LifeService {

    // 服务汇次页
    @GET(UrlConstants.Life + "serviceGroup/{id}")
    Call<LifeIndexListResp> lifeSecond(@Path("id") String id);

    //获取线上购物分类
    @GET(UrlConstants.getShopClassType)
    Call<ShopCategoryResp> getShopCategory(@Path("subId") String subId);

    //获取线上购物列表
    @GET(UrlConstants.getOnlineProgressList)
    Call<OnLineProductListResp> getOnlineProductList(@Query("subId") String subId, @Query("classId") String classId, @Query("curPage") int curPage, @Query("pageSize") int pageSize);

    //获取提供该服务的时间段接口
    @GET(UrlConstants.Life+ "servicePeriod/{subId}")
    Call<ServicePeriod> servicePeriod(@Path("subId") String subId);

    //商品详情接口
    @GET(UrlConstants.Life + "productDetails")
    Call<ProductDetailBean> productDetails(@Query("productId") String productId, @Query("idType") int idType);

    //校验商品金额数量等
    @FormUrlEncoded
    @POST(UrlConstants.Life  + "checkGoods")
    Call<CheckGoodsResult> checkGoods(@Field("userId") String userId,@Field("subId") String subId,@Field("specList") String specList);

    //购物车使用的红包接口
    @GET(UrlConstants.Life + "getRedPacketSC")
    Call<RedRed> getRedPacketSC(@Query("subId") String subId);

    //获取全部商家信息 只传subId 和 type为获取单个商家信息
    @GET(UrlConstants.Life + "busInfoBySubId")
    Call<BusInfoBySubIdPart> busInfoBySubIdPart(@Query("subId") String subId,@Query("type") String type,
    @Query("productId") String productId,@Query("idType") String idType,@Query("communityId") String communityId);

    // 获取商家信息
    @GET(UrlConstants.Life + "busInfoBySubId")
    Call<OnlineShopInfoResp> getOnlineShopInfo(@Query("subId") String subId, @Query("type") int type);

    // 获取商家评价列表
    @GET(UrlConstants.Life + "shop/appraise")
    Call<ShopCommentListResp> getShopCommentList(@QueryMap Map<String, String> params);

    //确认订单
    @FormUrlEncoded
    @POST(UrlConstants.orderConfirmUrl)
    Call<AddOrderResp> confirmOrder(@Field("orderInfo") String orderInfo, @Field("specList") String specList);

    //获取红包列表
    @GET(UrlConstants.getCanUseRedPacketUrl)
    Call<CanUseRedPacketResp> getRedPackets(@Query("userId") String userId,@Query("type") String type, @Query("subId") String subId, @Query("orderMoney") String orderMoney, @Query("communityId") String communityId, @Query("curPage") int curPage, @Query("pageSize") int pageSize);

    //获取支付宝订单信息
    @GET(UrlConstants.getAlipayUrl)
    Call<AliInfoResp> getAlipayInfo(@Query("orderId") String orderId, @Query("type") String type, @Query("versionId") String versionId);

    //获取周边楼盘
    @GET(UrlConstants.Surrounding_House)
    Call<SurroundingListResp> getSurroundingList(@Query("curPage") int curPage,@Query("pageSize") int pageSize);

    //获取官方租房列表
    @GET(UrlConstants.OfficialRentingList)
    Call<RentingHouseResp> getOfficialRentingList(@Query("curPage") int curPage, @Query("pageSize") int pageSize);

    //获取整租合租的列表
    @GET(UrlConstants.getPersonalRentingList)
    Call<PersonalRentingResp> getPersonalRentingList(@Query("communityId") String communityId,@Query("curPage") int curPage, @Query("pageSize") int pageSize);

    //上传多图片
    @Multipart
    @POST(UrlConstants.upload_pics)
    Call<UpLoadPicBean> uploadImages(@Path("type") String type, @Part List<MultipartBody.Part> partList);

    //发布合租整租
    @FormUrlEncoded
    @POST(UrlConstants.publish_personal_renting)
    Call<BaseEntity> publishRenting(@Field("topicTag") String topicTag,
                                    @Field("topicContent") String topicContent,
                                    @Field("picIds") List<String> picIds);

    //获取服务暂停时间
    @GET(UrlConstants.getServiceStopTime)
    Call<ServicePauseTime> getServiceStopTime(@Path("subId") String subId);

}

